package com.inspur.mc;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("mpp/tt")
public class MppController {
	@Autowired
	private MppMapper mppMapper;
	Logger log = LoggerFactory.getLogger(MppController.class);

	@RequestMapping
	@ResponseBody
	public void getMppData(String nf, String jpxz) {
		try {
			mppMapper.select(nf, jpxz);
		} catch (Exception e) {
			log.error("#############");
			e.printStackTrace();
		}
	}

	@RequestMapping(value = "2")
	@ResponseBody
	public void getMppData2(String nf, String jpxz) {
		try {
			mppMapper.select2(nf, jpxz);
		} catch (Exception e) {
			log.error("#############");
			e.printStackTrace();
		}
	}

	@RequestMapping(value = "4")

	@ResponseBody
	public void getMppData4(String nf, String jpxz) {
		try {
			mppMapper.select4(nf, jpxz);
		} catch (Exception e) {
			log.error("#############");
			e.printStackTrace();
		}
	}

	@RequestMapping("ll")
	@ResponseBody
	public String getMppDataLocal(String xm, String zjhm) {
		try {
			List<Map<String, String>> data = mppMapper.selectEr(xm, zjhm);
			String d = data.size() + "";
			return d;
		} catch (Exception e) {
			return "error";
		}
	}
}
